home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre2.z / postgre2 / doc / papers / pg_data_model. < prev    next >
Encoding:
Text File  |  1992-08-27  |  56.5 KB  |  1,676 lines

  1. .\"    @(#)bmac.std    2.4    10/15/84;
  2. .\" standard format troff commands
  3. .\" citation formatting strings
  4. .ds [[ [
  5. .ds ]] ]
  6. .ds ], ,\|
  7. .ds ]- -
  8. .ds [. " \&
  9. .ds .] .
  10. .ds [, " \&
  11. .ds ,] ,
  12. .ds [? " \&
  13. .ds ?] ?
  14. .ds [: " \&
  15. .ds :] :
  16. .ds [; " \&
  17. .ds ;] ;
  18. .ds [! " \&
  19. .ds !] !
  20. .ds [" " \&
  21. .ds "] \&"
  22. .ds [' " \&
  23. .ds '] '
  24. .ds [< " \&
  25. .ds >]
  26. .\" reference formmating strings
  27. .ds a] " \&
  28. .ds b] , \&
  29. .ds c] , \&
  30. .ds n] "\& and \&
  31. .ds m] "\& and \&
  32. .ds p] .
  33. .\" reference formmating macros
  34. .de s[   \" start reference
  35. .nh
  36. .IP [\\*([F] 5m
  37. ..
  38. .de e[   \" end reference
  39. .[-
  40. ..
  41. .de []   \" start to display collected references
  42. .LP
  43. ..
  44. .de ][   \" choose format
  45. .ie !"\\*([J"" \{\
  46. .    ie !"\\*([V"" .nr t[ 1    \" journal
  47. .    el            .nr t[ 5    \" conference paper
  48. .\}
  49. .el .ie !"\\*([B"" .nr t[ 3    \" article in book
  50. .el .ie !"\\*([R"" .nr t[ 4    \" technical report
  51. .el .ie !"\\*([I"" .nr t[ 2    \" book
  52. .el                .nr t[ 0    \" other
  53. .\\n(t[[
  54. ..
  55. .de 0[   \" other
  56. .s[
  57. .if !"\\*([A"" \\*([A\\c
  58. .if !"\\*([T"" , \\*([T\\c
  59. .if !"\\*([V"" , Vol. \\*([V\\c
  60. .if !"\\*([O"" , \\*([O\\c
  61. .if !"\\*([D"" , \\*([D\\c
  62. \&.
  63. .e[
  64. ..
  65. .de 1[ \" journal article
  66. .s[
  67. .if !"\\*([A"" \\*([A,
  68. .if !"\\*([T""  \\*(lq\\*([T\\*(rq,
  69. \\fI\\*([J \\*([V\\fP\c
  70. .ie !"\\*([N"" , \\*([N
  71. .el  
  72. .if !"\\*([D"" (\\*([D)\c
  73. .if !"\\*([P"" , \\*([P\c
  74. .if !"\\*([I"" , \\*([I\c
  75. \\&.
  76. .if !"\\*([O"" \\*([O.
  77. .e[
  78. ..
  79. .de 2[ \" book
  80. .s[
  81. .ie !"\\*([A"" \\*([A,
  82. .el .if !"\\*([E"" \{\
  83. .       ie \\n([E-1 \\*([E, eds.,
  84. .       el \\*([E, ed.,\}
  85. .if !"\\*([T"" \\fI\\*([T\\fP,
  86. .rm a[
  87. .if !"\\*([I"" .ds a[ \\*([I
  88. .if !"\\*([C"" \{\
  89. .       if !"\\*(a["" .as a[ , \\&
  90. .       as a[ \\*([C\}
  91. .if !"\\*([D"" \{\
  92. .       if !"\\*(a["" .as a[ , \\&
  93. .       as a[ \\*([D\}
  94. \\*(a[.
  95. .if !"\\*([G"" Gov. ordering no. \\*([G.
  96. .if !"\\*([O"" \\*([O.
  97. .e[
  98. ..
  99. .de 3[ \" article in book
  100. .s[
  101. .if !"\\*([A"" \\*([A,
  102. .if !"\\*([T"" \\*(lq\\*([T\\*(rq,
  103. in \\fI\\*([B\\fP\c
  104. .if !"\\*([V"" , vol. \\*([V
  105. .if !~\\*([E~~ \{\
  106. .       ie , \\n([E-1  \\*([E (editors)\c
  107. .       el , \\*([E (editor)\c\}
  108. .if !"\\*([I"" , \\*([I\c
  109. .if !"\\*([C"" , \\*([C\c
  110. .if !"\\*([D"" , \\*([D\c
  111. .if !"\\*([P"" , \\*([P\c
  112. \\&.
  113. .if !"\\*([O"" \\*([O.
  114. .e[
  115. ..
  116. .de 4[ \" report
  117. .s[
  118. .if !"\\*([A"" \\*([A,
  119. .if !~\\*([E~~ \{\
  120. .       ie \\n([E-1 \\*([E, editors.
  121. .       el \\*([E, editor.\}
  122. \&\\*(lq\\*([T\\*(rq,
  123. \\*([R\c
  124. .if !"\\*([G"" \& (\\*([G)\c
  125. .if !"\\*([I"" , \\*([I\c
  126. .if !"\\*([C"" , \\*([C\c
  127. .if !"\\*([D"" , \\*([D\c
  128. \\&.
  129. .if !"\\*([O"" \\*([O.
  130. .e[
  131. ..
  132. .de 5[ \" conference paper
  133. .s[
  134. .if !"\\*([A"" \\*([A,
  135. .if !"\\*([T"" \\*(lq\\*([T\\*(rq,
  136. \\fI\\*([J\\fP,
  137. .if !"\\*([C"" \\*([C,
  138. .if !"\\*([D"" \\*([D\c
  139. .if !"\\*([P"" , \\*([P\c
  140. \\&.
  141. .if !"\\*([O"" \\*([O.
  142. .e[
  143. ..
  144. .de [-   \" clean up after yourself
  145. .rm [A [B [C [D
  146. .rm [E [F [G
  147. .rm [I [J [K
  148. .rm [N [O [P
  149. .rm [R [T
  150. .rm [V [W
  151. ..
  152. .de s[   \" start reference
  153. .nh
  154. .IP [\\*([F] 10n
  155. ..
  156. .ll 6.5i
  157. .nr tp 10
  158. .nr fp 12
  159. .nr sp 12
  160. .nr pp 12
  161. .nr bi 2n
  162. .de IP
  163. .ip \\$1 \\$2
  164. ..
  165. .de LP
  166. .lp
  167. ..
  168. .de BE
  169. .(b
  170. .sz 9
  171. .ta .2i +.2i +.2i +.2i +.2i +.2i +.2i +.2i +.2i +.2i +.2i +.2i
  172. ..
  173. .de EE
  174. .re
  175. .sz \n(pp
  176. .)b
  177. ..
  178. .sz 12
  179. .sz \n(pp
  180. .fo ''%''
  181. .(l C
  182. .sz \n(sp
  183. .b
  184. The POSTGRES Data Model\u\(dg\d
  185. .sz \n(pp
  186. .\".sp
  187. .\".r 
  188. .\"(Draft printed: \*(td)
  189. .sp
  190. .i
  191. Lawrence A. Rowe 
  192. Michael R. Stonebraker
  193. .r
  194. .sp
  195. Computer Science Division, EECS Department
  196. University of California
  197. Berkeley, CA 94720
  198. .)l
  199. .\"    *** commands to set 1.5 spacing between lines ***
  200. .vs 16
  201. .nr $r \n(.vu/\n(.su
  202. .nr $R \n($r
  203. .\"       *** commands to set-up for conference paper ***
  204. .\".bp
  205. .\" set-up for conference paper printing
  206. .\" set 1.5 lines spacing.
  207. .\" set margins for conf paper
  208. .\".nr L 4.0i
  209. .\".ll \nLu
  210. .\"       *** end commands to set-up for conference paper ***
  211. .sp
  212. .\".2c
  213. .(f
  214. \(dg This research was supported by the National Science Foundation
  215. under Grant DCR-8507256 and 
  216. the Defense Advanced Research Projects Agency (DoD), Arpa
  217. Order No. 4871, monitored by Space and Naval Warfare Systems Command 
  218. under Contract N00039-84-C-0089.
  219. .)f
  220. .sp 2
  221. .(l C
  222. .sz \n(sp
  223. .b Abstract
  224. .)l
  225. .pp
  226. The design of the POSTGRES data model is described.
  227. The data model is a relational model that has been extended with
  228. abstract data types including user-defined operators and procedures,
  229. relation attributes of type procedure, and attribute
  230. and procedure inheritance.
  231. These mechanism can be used to simulate a wide variety of 
  232. semantic and object-oriented data modeling constructs
  233. including aggregation and generalization, complex objects
  234. with shared subobjects, and attributes that reference tuples
  235. in other relations.
  236. .sh 1 "Introduction"
  237. .pp
  238. This paper describes the data model for POSTGRES, a next-generation
  239. extensible database management system being developed at
  240. the University of California 
  241. \*([[StR86\*(]].
  242. The data model is based on the idea of extending the relational
  243. model developed by Codd\*([<\*([[Cod70\*(]]\*(>] with general
  244. mechanisms that can be used to simulate a variety of semantic
  245. data modeling constructs.
  246. The mechanisms include: 1) abstract data types (ADT's), 2) data of
  247. type procedure, and 3) rules.
  248. These mechanisms can be used to support complex objects or
  249. to implement a shared object hierarchy for an object-oriented 
  250. programming language\*([<\*([[Row86\*(]]\*(>].
  251. Most of these ideas have appeared elsewhere
  252. \*([[Ste84\*(],Sto85\*(],Sto86a\*(],Sto86b\*(]].
  253. .pp
  254. We have discovered that some semantic constructs that were
  255. not directly supported can be easily added to the system.
  256. Consequently, we have made several changes to the data model and the
  257. syntax of the query language that are documented here.
  258. These changes include providing support for primary keys,
  259. inheritance of data and procedures,
  260. and attributes that reference tuples in other relations.
  261. .pp
  262. The major contribution of this paper is to show that 
  263. inheritance can be added to a relational data model with only 
  264. a modest number of changes to the model and the implementation of the system.
  265. The conclusion that we draw from this result is that the major concepts
  266. provided in an object-oriented data model (e.g., structured attribute types,
  267. inheritance, union type attributes, and support for shared subobjects) 
  268. can be cleanly and efficiently supported 
  269. in an extensible relational database management system.
  270. The features used to support these mechanisms are abstract data types
  271. and attributes of type procedure.
  272. .pp
  273. The remainder of the paper describes the POSTGRES data model and 
  274. is organized as follows.
  275. Section 2 presents the data model.
  276. Section 3 describes the attribute type system.
  277. Section 4 describes how the query language can be extended
  278. with user-defined procedures.
  279. Section 5 compares the model with other data models and
  280. section 6 summarizes the paper.
  281. .sh 1 "Data Model"
  282. .pp
  283. A database is composed of a collection of \fIrelations\fP
  284. that contain tuples which represent real-world entities
  285. (e.g., documents and people) or relationships (e.g., authorship).
  286. A relation has attributes of fixed types 
  287. that represent properties of the entities and relationships
  288. (e.g., the title of a document) and a primary key.
  289. Attribute types can be atomic (e.g., integer, floating point,
  290. or boolean) or structured (e.g., array or procedure).
  291. The primary key is a sequence of attributes of the relation,
  292. when taken together, uniquely identify each tuple.
  293. .pp
  294. A simple university database will be used to illustrate the model.
  295. The following command defines a relation that represents people:
  296. .BE
  297. \fBcreate\fP PERSON ( Name = char[25], 
  298.     Birthdate = date, Height = int4,
  299.     Weight = int4, StreetAddress = char[25], 
  300.     City = char[25], State = char[2])
  301. .EE
  302. This command defines a relation and creates a structure for storing the tuples.
  303. .pp
  304. The definition of a relation may optionally specify a 
  305. primary key and other relations from which to inherit attributes.
  306. A primary key is a combination of attributes that uniquely identify each tuple.
  307. The key is specified with a \fBkey\fP-clause as follows:
  308. .BE
  309. \fBcreate\fP PERSON ( \.\ \.\ \.)
  310. \fBkey\fP (Name)
  311. .EE
  312. Tuples must have a value for all key attributes.
  313. The specification of a key may optionally include the name of an
  314. operator that is to be used when comparing two tuples.
  315. For example, suppose a relation had a key whose type
  316. was a user-defined ADT.
  317. If an attribute of type \fIbox\fP was part of the primary key,
  318. the comparison operator must be specified 
  319. since different \fIbox\fP operators could be used
  320. to distinguish the entries (e.g., area equals or box equality).  
  321. The following example shows the definition of a relation with a 
  322. key attribute of type \fIbox\fP that
  323. uses the area equals operator (\fIAE\fP) to determine key value equality:
  324. .BE
  325. \fBcreate\fP PICTURE(Title = char[25], Item = box)
  326. \fBkey\fP (Item \fBusing\fP AE)
  327. .EE
  328. .pp
  329. Data inheritance is specified with an \fBinherits\fP-clause.
  330. Suppose, for example, that people in the university database
  331. are employees and/or students and that different 
  332. attributes are to be defined for each category.
  333. The relation for each category includes the \fIPERSON\fP
  334. attributes and the attributes that are specific to the 
  335. category.
  336. These relations can be defined by replicating the \fIPERSON\fP
  337. attributes in each relation definition or by inheriting them
  338. for the definition of \fIPERSON\fP.
  339. Figure 1 shows the relations and an inheritance hierarchy that
  340. could be used to share the definition of the attributes.
  341. .(z
  342. .hl
  343. .sp 2i
  344. .sp
  345. .ce
  346. Figure 1: Relation hierarchy.
  347. .hl
  348. .)z
  349. The commands that define the relations other than the
  350. \fIPERSON\fP relation defined above are:
  351. .BE
  352. \fBcreate\fP EMPLOYEE (Dept = char[25],
  353.     Status = int2, Mgr = char[25],
  354.     JobTitle = char[25], Salary = money)
  355. \fBinherits\fP (PERSON)
  356. .sp 0.5v
  357. \fBcreate\fP STUDENT (Sno = char[12],
  358.     Status = int2, Level = char[20])
  359. \fBinherits\fP (PERSON)
  360. .sp 0.5v
  361. \fBcreate\fP STUDEMP (IsWorkStudy = bool)
  362. \fBinherits\fP (STUDENT, EMPLOYEE)
  363. .EE
  364. .pp
  365. A relation inherits all attributes from its parent(s) unless an attribute
  366. is overriden in the definition.
  367. For example, the \fIEMPLOYEE\fP relation inherits the \fIPERSON\fP
  368. attributes \fIName\fP, \fIBirthdate\fP, \fIHeight\fP, \fIWeight\fP,
  369. \fIStreetAddress\fP, \fICity\fP, and \fIState\fP.
  370. Key specifications are also inherited so \fIName\fP is also the key
  371. for EMPLOYEE.
  372. .pp
  373. Relations may inherit attributes from more than one parent.
  374. For example, \fISTUDEMP\fP inherits attributes from \fISTUDENT\fP
  375. and \fIEMPLOYEE\fP.
  376. An inheritance conflict occurs when the same attribute name is inherited from
  377. more than one parent (e.g., \fISTUDEMP\fP
  378. inherits \fIStatus\fP from \fIEMPLOYEE\fP and \fISTUDENT\fP\|).
  379. If the inherited attributes have the same type, an attribute
  380. with the type is included in the relation that is being defined.
  381. Otherwise, the declaration is disallowed.\**
  382. .(f
  383. \** Most attribute inheritance models have a conflict resolution
  384. rule that selects one of the conflicting attributes.
  385. We chose to disallow inheritance because we could not discover
  386. an example where it made sense, except when the types were identical.
  387. On the other hand, procedure inheritance (discussed below) does use
  388. a conflict resolution rule because many examples exist in which
  389. one procedure is prefered.
  390. .)f
  391. .pp
  392. The POSTGRES query language is a generalized version of 
  393. QUEL\*([<\*([[HSW75\*(]]\*(>], called \fIPOSTQUEL\fP.
  394. QUEL was extended in several directions.
  395. First, POSTQUEL has a \fBfrom\fP-clause to define tuple-variables
  396. rather than a \fBrange\fP command.
  397. Second, arbitrary relation-valued expressions may appear any place
  398. that a relation name could appear in QUEL.
  399. Third, transitive closure and \fBexecute\fP commands
  400. have been added to the language\*([<\*([[Kue84\*(]]\*(>].
  401. And lastly, POSTGRES maintains historical data so POSTQUEL
  402. allows queries to be run on past
  403. database states or on any data that was in the database at any time.
  404. These extensions are described in the remainder of this section.
  405. .pp
  406. The \fBfrom\fP-clause was added to the language so that tuple-variable
  407. definitions for a query could be easily determined at compile-time.
  408. This capability was needed because POSTGRES will, at the user's
  409. request, compile queries and save them in the system catalogs.
  410. The \fBfrom\fP-clause is illustrated in
  411. the following query that lists all work-study students who
  412. are sophomores:
  413. .BE
  414. \fBretrieve\fP (SE.name)
  415. \fBfrom\fP SE \fBin\fP STUDEMP
  416. \fBwhere\fP SE.IsWorkStudy
  417. \ \ \ \ \fBand\fP SE.Status = ``sophomore''
  418. .EE
  419. The \fBfrom\fP-clause specifies the set of tuples over which a
  420. tuple-variable will range.
  421. In this example, the tuple-variable \fISE\fP ranges over the set
  422. of student employees.
  423. .pp
  424. A default tuple-variable with the same name is defined for each relation
  425. referenced in the target-list or \fBwhere\fP-clause of a query.
  426. For example, the query above could have been written:
  427. .BE
  428. \fBretrieve\fP (STUDEMP.name)
  429. \fBwhere\fP STUDEMP.IsWorkStudy
  430. \ \ \ \ \fBand\fP STUDEMP.Status = ``sophomore''
  431. .EE
  432. Notice that the attribute \fIIsWorkStudy\fP is a boolean-valued attribute
  433. so it does not require an explicit value test (e.g., 
  434. \fISTUDEMP.IsWorkStudy = ``true''\fP\|).
  435. .pp
  436. The set of tuples that a tuple-variable may range over can be a 
  437. named relation or a relation-expression.
  438. For example, suppose the user wanted to retrieve all students in the database
  439. who live in Berkeley regardless of
  440. whether they are students or student employees.
  441. This query can be written as follows:
  442. .BE
  443. \fBretrieve\fP (S.name)
  444. \fBfrom\fP S \fBin\fP STUDENT*
  445. \fBwhere\fP S.city = ``Berkeley''
  446. .EE
  447. The ``*'' operator specifies the relation formed by taking
  448. the union of the named relation (i.e., \fISTUDENT\fP) and
  449. all relations that inherit attributes from it (i.e., \fISTUDEMP\fP).
  450. If the ``*'' operator was not used, the query retrieves only tuples
  451. in the student relation (i.e., students who are not student employees).
  452. In most data models that support inheritance the relation name defaults
  453. to the union of relations over the inheritance hierarchy (i.e., the
  454. data described by \fISTUDENT*\fP above).
  455. We chose a different default because queries that involve unions will
  456. be slower than queries on a single relation.
  457. By forcing the user to request the union explicitly with the ``*''
  458. operator, he will be aware of this cost.
  459. .pp
  460. Relation expressions may include other set operators:
  461. .EQ
  462. delim $$
  463. .EN
  464. union ($union$), intersection ($inter$), and difference (\-).
  465. For example, the following query retrieves the names of people
  466. who are students or employees but not student employees:
  467. .BE
  468. \fBretrieve\fP (S.name)
  469. \fBfrom\fP S \fBin\fP (STUDENT $union$ EMPLOYEE)
  470. .EE
  471. Suppose a tuple does not have an attribute referenced elsewhere
  472. in the query.
  473. If the reference is in the target-list, the return tuple will not 
  474. contain the attribute.\**
  475. .(f
  476. \** The application program interface to POSTGRES allows the stream
  477. of tuples passed back to the program to have dynamically varying
  478. columns and types.
  479. .)f
  480. If the reference is in the qualification, the clause containing
  481. the qualification is ``false''.
  482. .pp
  483. POSTQUEL also provides set comparison operators and a relation-constructor
  484. that can be used to specify some difficult queries more easily than in a 
  485. conventional query language.
  486. .EQ
  487. delim off
  488. .EN
  489. For example, suppose that students could have several majors.
  490. The natural representation for this data is to define a separate
  491. relation:
  492. .BE
  493. \fBcreate\fP MAJORS(Sname = char[25],
  494.     Mname = char[25])
  495. .EE
  496. where \fISname\fP is the student's name and \fIMname\fP is the major.
  497. With this representation, the following query retrieves the names of students
  498. with the same majors as Smith:
  499. .BE
  500. \fBretrieve\fP (M1.Sname)
  501. \fBfrom\fP M1 \fBin\fP MAJORS
  502. \fBwhere\fP {(x.Mname) \fBfrom\fP x \fBin\fP MAJORS 
  503.             \fBwhere\fP x.Sname = M1.Sname}
  504.    \(sb {(x.Mname) \fBfrom\fP x \fBin\fP MAJORS
  505.         \fBwhere\fP x.Sname=``Smith''} 
  506. .EE
  507. The expressions enclosed in set symbols (``{\...}'') are 
  508. relation-constructors.
  509. .pp
  510. The general form of a relation-constructor\** is
  511. .(f
  512. \** Relation constructors are really aggregate functions.
  513. We have designed a mechanism to support extensible aggregate functions,
  514. but have not yet worked out the query language syntax and semantics.
  515. .)f
  516. .BE
  517. {(\fItarget-list\fP\|)    \fBfrom\fP \fIfrom-clause\fP
  518.             \fBwhere\fP \fIwhere-clause\fP}
  519. .EE
  520. which specifies the same relation as the query
  521. .BE
  522. \fBretrieve\fP (\fItarget-list\fP\|)
  523. \fBfrom\fP \fIfrom-clause\fP
  524. \fBwhere\fP \fIwhere-clause\fP
  525. .EE
  526. Note that a tuple-variable defined in the outer query (e.g., M1 in
  527. the query above) can be used within a relation-constructor but that a
  528. tuple-variable defined in the relation-constructor cannot be used in
  529. the outer query.
  530. Redefinition of a tuple-variable in a relation constructor creates a
  531. distinct variable as in a block-structured programming language
  532. (e.g., PASCAL).
  533. Relation-valued expressions (including attributes of type procedure
  534. described in the next section) can be used any place in a query that
  535. a named relation can be used.
  536. .pp
  537. Database updates are specified with conventional update
  538. commands as shown in the following examples:
  539. .BE
  540. /* Add a new employee to the database. */
  541. \fBappend\fP \fBto\fP EMPLOYEE(name = \fIvalue\fP,
  542.     age = \fIvalue\fP, ...)
  543. .sp
  544. /* Change state codes using 
  545.     MAP(OldCode, NewCode). */
  546. \fBreplace\fP P(State = MAP.NewCode)
  547. \fBfrom\fP P \fBin\fP PERSON*
  548. \fBwhere\fP P.State = MAP.OldCode
  549. .sp
  550. /* Delete students born before today. */
  551. \fBdelete\fP STUDENT
  552. \fBwhere\fP STUDENT.Birthdate < ``today''
  553. .EE
  554. Deferred update semantics are used for all updates commands.
  555. .pp
  556. POSTQUEL supports the transitive closure commands developed in QUEL*
  557. \*([[Kue84\*(]].
  558. A ``*'' command continues to execute until no
  559. tuples are retrieved (e.g., \fBretrieve*\fP\|) or updated
  560. (e.g., \fBappend*\fP, \fBdelete*\fP, or \fBreplace*\fP\|).
  561. For example, the following query creates a relation that contains
  562. all employees who work for Smith:
  563. .BE
  564. \fBretrieve* into\fP SUBORD(E.Name, E.Mgr)
  565. \fBfrom\fP E \fBin\fP EMPLOYEE, S \fBin\fP SUBORD
  566. \fBwhere\fP E.Name = ``Smith''
  567.     \fBor\fP E.Mgr = S.Name
  568. .EE
  569. This command continues to execute the \fBretrieve-into\fP command
  570. until there are no changes made to the \fISUBORD\fP relation.
  571. .pp
  572. Lastly, POSTGRES saves data deleted from or modified
  573. in a relation so that queries can be executed on historical data.
  574. For example, the following query looks for students who
  575. lived in Berkeley on August 1, 1980:
  576. .BE
  577. \fBretrieve\fP (S.Name)
  578. \fBfrom\fP S \fBin\fP STUDENT[``August 1, 1980'']
  579. \fBwhere\fP S.City = ``Berkeley''
  580. .EE
  581. The date specified in the brackets following the relation name specifies
  582. the relation at the designated time.
  583. The date can be specified in many different formats and optionally
  584. may include a time of day.
  585. The query above only examines students who are not student employees.
  586. To search the set of all students, the \fBfrom\fP-clause would be
  587. .BE
  588.  ...\fBfrom\fP S \fBin\fP STUDENT*[``August 1, 1980'']
  589. .EE
  590. .pp
  591. Queries can also be executed on all data that is currently in the
  592. relation or was in it at some time in the past (i.e., all data).
  593. The following query retrieves all students who ever lived in Berkeley:
  594. .BE
  595. \fBretrieve\fP (S.Name)
  596. \fBfrom\fP S \fBin\fP STUDENT[]
  597. \fBwhere\fP S.City = ``Berkeley''
  598. .EE
  599. The notation ``[]'' can be appended to any relation name.
  600. .pp
  601. Queries can also be specified on data that was in the relation during
  602. a given time period.
  603. The time period is specified by
  604. giving a start- and end-time as shown in the
  605. following query that retrieves students who lived in Berkeley at
  606. any time in August 1980:
  607. .BE
  608. \fBretrieve\fP (S.Name)
  609. \fBfrom\fP S \fBin\fP STUDENT*[``August 1, 1980'',
  610.                                 ``August 31, 1980'']
  611. \fBwhere\fP S.City = ``Berkeley''
  612. .EE
  613. Shorthand notations are supported for all tuples in a relation up
  614. to some date (e.g., \fISTUDENT*[,``August 1, 1980'']\fP\|) or from
  615. some date to the present (e.g., \fISTUDENT*[``August 1, 1980'',\|]\fP\|).
  616. .pp
  617. The POSTGRES default is to save all data unless the user explicitly
  618. requests that data be purged.
  619. Data can be purged before a specific data (e.g., before January 1, 1987)
  620. or before some time period (e.g., before six months ago).
  621. The user may also request that all historical data be purged so that
  622. only the current data in the relation is stored.
  623. .pp
  624. POSTGRES also supports versions of relations.
  625. A version of a relation can be created from a relation or a snapshot.
  626. A version is created by specifying the base relation as shown
  627. in the command
  628. .BE
  629. \fBcreate version\fP MYPEOPLE \fBfrom\fP PERSON
  630. .EE
  631. that creates a version, named \fIMYPEOPLE\fP, derived from
  632. the \fIPERSON\fP relation.
  633. Data can be retrieved from and updated in a version just like a relation.
  634. Updates to the version do not modify the base relation.
  635. However, updates to the base relation are propagated to
  636. the version unless the value has been modified.
  637. For example, if George's birthdate is changed in \fIMYPEOPLE\fP, 
  638. a \fBreplace\fP command that changes
  639. his birthdate in \fIPERSON\fP will not be propagated to \fIMYPEOPLE\fP.
  640. .pp
  641. If the user does not want updates to the base relation to propagate to
  642. the version, he can create a version of a snapshot.
  643. A snapshot is a copy of the current contents of a relation 
  644. \*([[AdL80\*(]].
  645. A version of a snapshot is created by the following command:
  646. .BE
  647. \fBcreate version\fP YOURPEOPLE
  648. \fBfrom\fP PERSON[``now'']
  649. .EE
  650. The snapshot version can be updated directly by issuing update commands
  651. on the version.
  652. But, updates to the base relation are not propagated to the version.
  653. .pp
  654. A \fBmerge\fP command is provided to merge changes 
  655. made to a version back into the base relation.
  656. An example of this command is
  657. .BE
  658. \fBmerge\fP YOURPEOPLE \fBinto\fP PERSON
  659. .EE
  660. that will merge the changes made to \fIYOURPEOPLE\fP back into 
  661. \fIPERSON\fP.
  662. The \fBmerge\fP command uses a semi-automatic procedure to resolve 
  663. updates to the underlying relation and the version that conflict 
  664. \*([[Gae84\*(]].
  665. .pp
  666. This section described most of the data definition and data manipulation
  667. commands in POSTQUEL.
  668. The commands that were not described are the commands for defining
  669. rules,
  670. utility commands that only affect the performance of the system 
  671. (e.g., \fBdefine index\fP and \fBmodify\fP),
  672. and other miscellaneous utility commands (e.g., \fBdestroy\fP and \fBcopy\fP).
  673. The next section describes the type system for relation attributes.
  674. .sh 1 "Data Types"
  675. .pp
  676. POSTGRES provides a collection of atomic and structured types.
  677. The predefined atomic types include:
  678. \fIint2\fP, \fIint4\fP, \fIfloat4\fP, \fIfloat8\fP,
  679. \fIbool\fP, \fIchar\fP, and \fIdate\fP.
  680. The standard arithmetic and comparison operators are provided
  681. for the numeric and date data types and the standard string and comparison
  682. operators for character arrays.
  683. Users can extend the system by adding new atomic types using an abstract
  684. data type (ADT) definition facility.
  685. .pp
  686. All atomic data types are defined to the system as ADT's.
  687. An ADT is defined by specifying the type name, the length of the
  688. internal representation in bytes, procedures for converting from an external
  689. to internal representation for a value and from an internal
  690. to external representation, and a default value.
  691. The command
  692. .BE
  693. \fBdefine type\fP int4 \fBis\fP (InternalLength = 4,
  694.     InputProc = CharToInt4,
  695.     OutputProc = Int4ToChar, Default = ``0'')
  696. .EE
  697. defines the type \fIint4\fP which is predefined in the system.
  698. \fICharToInt4\fP and \fIInt4ToChar\fP are procedures that are coded in
  699. a conventional programming language (e.g., C) and  defined to the system
  700. using the commands described in section 4.
  701. .pp
  702. Operators on ADT's are defined by specifying the 
  703. the number and type of operands, the return type, 
  704. the precedence and associativity
  705. of the operator, and the procedure that implements it.
  706. For example, the command
  707. .BE
  708. \fBdefine operator\fP ``+''(int4, int4) \fBreturns\f int4
  709.     \fBis\fP (Proc = Plus, Precedence = 5,
  710.         Associativity = ``left'')
  711. .EE
  712. defines the plus operator.
  713. Precedence is specified by a number.
  714. Larger numbers imply higher precedence.
  715. The predefined operators have the precedences shown in figure 2.
  716. .(z
  717. .hl
  718. .TS
  719. center box;
  720. c | l.
  721. \fBPrecedence    Operators\fP
  722. =
  723. 80    \(ua
  724. _
  725. 70    \fBnot\fP \- (unary)
  726. _
  727. 60    * /
  728. _
  729. 50    + \- (binary)
  730. _
  731. 40    < \(<= > \(>=
  732. _
  733. 30    = \(!=
  734. _
  735. 20    \fBand\fP
  736. _
  737. 10    \fBor\fP
  738. .TE
  739. .sp
  740. .ce
  741. Figure 2: Predefined operators precedence.
  742. .hl
  743. .)z
  744. These precedences can be changed by changing the operator definitions.
  745. Associativity is either left or right depending on the semantics desired.
  746. This example defined an operator denoted by a symbol (i.e., ``+'').
  747. Operators can also be denoted by identifiers as shown below.
  748. .pp
  749. Another example of an ADT definition is the following command that
  750. defines an ADT that represents boxes:
  751. .BE
  752. \fBdefine type\fP box \fBis\fP (InternalLength = 16,
  753.     InputProc = CharToBox,
  754.     OutputProc = BoxToChar, Default = ``'')
  755. .EE
  756. The external representation of a box is a character string
  757. that contains two points that represent the upper-left and lower-right
  758. corners of the box.
  759. With this representation, the constant
  760. .BE
  761. ``20,50:10,70''
  762. .EE
  763. describes a box whose upper-left corner is at (20, 50) and lower-right
  764. corner is at (10, 70).
  765. \fICharToBox\fP takes a character string like this one and returns a 16 byte
  766. representation of a box (e.g., 4 bytes per x- or y-coordinate value).
  767. \fIBoxToChar\fP is the inverse of \fICharToBox\fP
  768. .pp
  769. Comparison operators can be defined on ADT's that can be used in
  770. access methods or optimized in queries.
  771. For example, the definition
  772. .BE
  773. \fBdefine operator\fP AE(box, box) \fBreturns\f bool
  774.     \fBis\fP (Proc = BoxAE, Precedence = 3,
  775.         Associativity = ``left'', Sort = BoxArea, 
  776.         Hashes, Restrict = AERSelect,
  777.         Join = AEJSelect, Negator = BoxAreaNE)
  778. .EE
  779. defines an operator ``area equals'' on boxes.
  780. In addition to the semantic information about the operator itself,
  781. this specification includes information used by POSTGRES
  782. to build indexes and to optimize queries using the operator.
  783. For example, suppose the \fIPICTURE\fP relation was defined by
  784. .BE
  785. \fBcreate\fP PICTURE(Title = char[], Item = box)
  786. .EE
  787. and the query
  788. .BE
  789. \fBretrieve\fP (PICTURE.\fBall\fP)
  790. \fBwhere\fP PICTURE.Item AE ``50,100:100,50''
  791. .EE
  792. was executed.
  793. The \fISort\fP property of the \fIAE\fP operator specifies 
  794. the procedure to be used to sort the relation if
  795. a merge-sort join strategy was selected to implement the query.
  796. It also specifies the procedure to use when building an ordered
  797. index (e.g., B-Tree) on an attribute of type \fIbox\fP.
  798. The \fIHashes\fP property indicates that this operator can be used
  799. to build a hash index on a \fIbox\fP attribute.
  800. Note that either type of index can be used to optimize the query above.
  801. The \fIRestrict\fP and \fIJoin\fP properties specify the procedure that
  802. is to be called by the query optimizer to compute the restrict and join
  803. selectivities, respectively, of a clause involving the operator.
  804. These selectivity properties specify procedures that will
  805. return a floating point value between 0.0 and 1.0 that indicate the
  806. attribute selectivity given the operator.
  807. Lastly, the \fINegator\fP property specifies the procedure that is
  808. to be used to compare two values when a query predicate requires the
  809. operator to be negated as in
  810. .BE
  811. \fBretrieve\fP (PICTURE.\fBall\fP)
  812. \fBwhere\fP \fBnot\fP (PICTURE.Item 
  813.                     AE ``50,100:100,50'')
  814. .EE
  815. The \fBdefine operator\fP command also may specify a procedure that
  816. can be used if the query predicate includes an operator that is not
  817. commutative.
  818. For example, the commutator procedure for ``area less than'' (\fIALT\fP) 
  819. is the procedure that implements ``area greater than or equal'' (\fIAGE\fP).
  820. More details on the use of these properties is given elsewhere\*([<\*([[Sto86b\*(]]\*(>].
  821. .pp
  822. Type-constructors are provided to define structured types
  823. (e.g., arrays and procedures) that can be used to represent complex data.
  824. An \fIarray\fP type-constructor can be used to define a 
  825. variable- or fixed-size array.
  826. A fixed-size array is declared by specifying the element
  827. type and upper bound of the array as illustrated by
  828. .BE
  829. \fBcreate\fP PERSON(Name = char[25])
  830. .EE
  831. which defines an array of twenty-five characters.
  832. The elements of the array are referenced by indexing the
  833. attribute by an integer between 1 and 25 (e.g., ``\fIPERSON.Name[4]\fP''
  834. references the fourth character in the person's name).
  835. .pp
  836. A variable-size array is specified by omitting the upper bound in the
  837. type constructor.
  838. For example, a variable-sized array of characters
  839. is specified by ``char[].''
  840. Variable-size arrays are referenced by indexing the
  841. attribute by an integer between 1 and the current upper bound
  842. of the array.
  843. The predefined function \fIsize\fP returns the current upper bound.
  844. POSTGRES does not impose a limit on the size of a
  845. variable-size array.
  846. Built-in functions are provided to append arrays and to fetch
  847. array slices.
  848. For example, two character arrays can be appended using the
  849. concatenate operator (``+'') and an array slice containing characters
  850. 2 through 15 in an attribute named \fIx\fP can be fetched by the 
  851. expression ``x[2:15].''
  852. .pp
  853. The second type-constructor allows values of type procedure to be stored in
  854. an attribute.
  855. Procedure values are represented by a sequence of POSTQUEL commands.
  856. The value of an attribute of type procedure is a relation
  857. because that is what a \fBretrieve\fP command returns.
  858. Moreover, the value may include tuples from different relations
  859. (i.e., of different types) because a procedure composed of two 
  860. \fBretrieve\fP commands returns the union of both commands.
  861. We call a relation with different tuple types a \fImultirelation\fP.
  862. The POSTGRES programming language interface provides a cursor-like
  863. mechanism, called a \fIportal\fP, to fetch values from multirelations
  864. \*([[StR86\*(]].
  865. However, they are not stored by the system (i.e., only relations
  866. are stored).
  867. .pp
  868. The system provides two kinds of procedure type-constructors: 
  869. variable and parameterized.
  870. A variable procedure-type allows a different POSTQUEL procedure
  871. to be stored in each tuple while parameterized procedure-types
  872. store the same procedure in each tuple but with different parameters.
  873. We will illustrate the use of a variable procedure-type 
  874. by showing another way to represent student majors.
  875. Suppose a \fIDEPARTMENT\fP relation was defined with the following command:
  876. .BE
  877. \fBcreate\fP DEPARTMENT(Name = char[25],
  878.     Chair = char[25], ...)
  879. .EE
  880. A student's major(s) can then be represented by a procedure in the \fISTUDENT\fP
  881. relation that retrieves the appropriate \fIDEPARTMENT\fP tuple(s).
  882. The \fIMajors\fP attribute would be declared as follows:
  883. .BE
  884. \fBcreate\fP STUDENT(..., Majors = postquel, ...)
  885. .EE
  886. Data type \fIpostquel\fP represents a procedure-type.
  887. The value in \fIMajors\fP will be a query that fetches the
  888. department relation tuples that represent the student's minors.
  889. The following command appends a student to the database who has
  890. a double major in
  891. mathematics and computer science:
  892. .BE
  893. \fBappend\fP STUDENT( Name = ``Smith'', ...,
  894.     Majors = 
  895.         ``\fBretrieve\fP (D.\fBall\fP)
  896.         \ \fBfrom\fP D \fBin\fP DEPARTMENT
  897.         \ \fBwhere\fP\ D.Name = ``Math''
  898.         \ \ \ \ \ \ \fBor\fP\|\ D.Name = ``CS'''')
  899. .EE
  900. .pp
  901. A query that references the \fIMajors\fP attribute 
  902. returns the string that contains the POSTQUEL commands.
  903. However, two notations are provided that will execute the query
  904. and return the result rather than the definition.
  905. First, nested-dot notation implicitly executes the query as illustrated by
  906. .BE
  907. \fBretrieve\fP (S.Name, S.Majors.Name)
  908. \fBfrom\fP S \fBin\fP STUDENT
  909. .EE
  910. which prints a list of names and majors of students.
  911. The result of the query in \fIMajors\fP is implicitly joined with the 
  912. tuple specified by the rest of the target-list.
  913. In other words, if a student has two majors, this query will return
  914. two tuples with the \fIName\fP attribute repeated.
  915. The implicit join is performed to guarantee that a relation is returned.
  916. .pp
  917. The second way to execute the query is to use the \fBexecute\fP
  918. command.
  919. For example, the query
  920. .BE
  921. \fBexecute\fP (S.Majors)
  922. \fBfrom\fP S \fBin\fP STUDENT
  923. \fBwhere\fP S.Name = ``Smith''
  924. .EE
  925. returns a relation that contains \fIDEPARTMENT\fP tuples
  926. for all of Smith's majors.
  927. .pp
  928. Parameterized procedure-types are used when the query to be stored
  929. in an attribute is nearly the same for every tuple.
  930. The query parameters can be taken from other attributes in the tuple
  931. or they may be explicitly specified.
  932. For example, suppose an attribute in \fISTUDENT\fP
  933. was to represent the student's current class list.
  934. Given the following definition for enrollments:
  935. .BE
  936. \fBcreate\fP ENROLLMENT(Student = char[25],
  937.     Class = char[25])
  938. .EE
  939. Bill's class list can be retrieved by the query
  940. .BE
  941. \fBretrieve\fP (ClassName = E.Class)
  942. \fBfrom\fP E \fBin\fP ENROLLMENT
  943. \fBwhere\fP E.Student = ``Bill''
  944. .EE
  945. This query will be the same for every student except for the 
  946. constant that specifies the student's name.
  947. .pp
  948. A parameterized procedure-type could be defined to represent
  949. this query as follows:
  950. .BE
  951. \fBdefine type\fP classes \fBis\fP
  952.     \fBretrieve\fP (ClassName = E.Class)
  953.     \fBfrom\fP E \fBin\fP ENROLLMENT
  954.     \fBwhere\fP E.Student = $.Name
  955. \fBend\fP
  956. .EE
  957. The dollar-sign symbol (``$'') refers to the tuple in which 
  958. the query is stored (i.e., the current tuple).
  959. The parameter for each instance of this type (i.e., a query)
  960. is the \fIName\fP attribute in the tuple in which the instance is stored.
  961. This type is then used in the \fBcreate\fP command as follows
  962. .BE
  963. \fBcreate\fP STUDENT(Name = char[25], ..., 
  964.     ClassList = classes)
  965. .EE
  966. to define an attribute that represents the student's current class list.
  967. This attribute can be used in a query
  968. to return a list of students and the classes they are taking:
  969. .BE
  970.     \fBretrieve\fP (S.Name, S.ClassList.ClassName)
  971. .EE
  972. Notice that for a particular \fISTUDENT\fP tuple, the
  973. expression ``\fI$.\|Name\fP'' in the query refers to the name of that student.
  974. The symbol ``$'' can be thought of as a tuple-variable bound to
  975. the current tuple.
  976. .pp
  977. Parameterized procedure-types are extremely useful types, but
  978. sometimes it is inconvenient to store the parameters explicitly
  979. as attributes in the relation.
  980. Consequently, a notation is provided that allows the 
  981. parameters to be stored in the procedure-type value.
  982. This mechanism can be used to simulate attribute types that
  983. reference tuples in other relations.
  984. For example, suppose you wanted a type that referenced a tuple
  985. in the \fIDEPARTMENT\fP relation defined above.
  986. This type can be defined as follows:
  987. .BE
  988. \fBdefine type\fP DEPARTMENT(int4) \fBis\fP
  989.     \fBretrieve\fP (DEPARTMENT.\fBall\fP)
  990.     \fBwhere\fP DEPARTMENT.oid = $1
  991. \fBend\fP
  992. .EE
  993. The relation name can be used for the type name
  994. because relations, types, and procedures have separate name
  995. spaces.
  996. The query in type \fIDEPARTMENT\fP will retrieve a specific department
  997. tuple given a unique object identifier (\fIoid\fP\|) of the
  998. tuple.
  999. Each relation has an implicitly defined attribute named \fIoid\fP
  1000. that contains the tuple's unique identifier.
  1001. The \fIoid\fP attribute can be accessed
  1002. but not updated by user queries.
  1003. \fIOid\fP values are created and maintained by the POSTGRES storage
  1004. system\*([<\*([[Sto87\*(]]\*(>].
  1005. The formal argument to this procedure-type is the type of an object
  1006. identifier.
  1007. The parameter is referenced inside the 
  1008. definition by ``\fI$n\fP'' where \fIn\fP is the parameter number.
  1009. .pp
  1010. An actual argument is supplied when a value is assigned to an
  1011. attribute of type \fIDEPARTMENT\fP.
  1012. For example, a \fICOURSE\fP relation can be defined that represents
  1013. information about a specific course including the department that
  1014. offers it.
  1015. The \fBcreate\fP command is:
  1016. .BE
  1017. \fBcreate\fP COURSE(Title = char[25],
  1018.     Dept = DEPARTMENT, ...)
  1019. .EE
  1020. The attribute \fIDept\fP represents the department that offers
  1021. the course.
  1022. The following query adds a course to the database:
  1023. .BE
  1024. \fBappend\fP COURSE(
  1025.     Title = ``Introductory Programming'',
  1026.     Dept = DEPARTMENT(D.oid))
  1027. \fBfrom\fP D \fBin\fP DEPARTMENT
  1028. \fBwhere\fP D.Name = ``computer science''
  1029. .EE
  1030. The procedure \fIDEPARTMENT\fP called in the target-list is 
  1031. implicitly defined by the ``\fBdefine type\fP'' command.
  1032. It constructs a value of the specified type given actual arguments
  1033. that are type compatible with the formal arguments, in this case an \fIint4\fP.
  1034. .pp
  1035. Parameterized procedure-types that represent references to tuples
  1036. in a specific relation are so commonly used that we plan to provide
  1037. automatic support for them.
  1038. First, every relation created will have a type that represents a reference
  1039. to a tuple implicitly defined similar to the \fIDEPARTMENT\fP 
  1040. type above.
  1041. And second, it will be possible to assign a tuple-variable directly
  1042. to a tuple reference attribute.
  1043. In other words, the assignment to the attribute \fIDept\fP that is 
  1044. written in the query above as
  1045. .BE
  1046.  ... Dept = DEPARTMENT(D.oid) ...
  1047. .EE
  1048. can be written as
  1049. .BE
  1050.  ... Dept = D ...
  1051. .EE
  1052. .pp
  1053. Parameterized procedure-types can also be used to implement a
  1054. type that references a tuple in an arbitrary relation.
  1055. The type definition is:
  1056. .BE
  1057. \fBdefine type\fP tuple(char[], int4) \fBis\fP
  1058.     \fBretrieve\fP ($1.all)
  1059.     \fBwhere\fP $1.oid = $2
  1060. \fBend\fP
  1061. .EE
  1062. The first argument is the name of the relation and the second argument
  1063. is the \fIoid\fP of the desired tuple in the relation.
  1064. In effect, this type defines a reference to an arbitrary tuple in the
  1065. database.
  1066. .pp
  1067. The procedure-type \fItuple\fP can be used to create a relation 
  1068. that represents people who help with fund raising:
  1069. .BE
  1070. \fBcreate\fP VOLUNTEER(Person = tuple,
  1071.     TimeAvailable = integer, ...)
  1072. .EE
  1073. Because volunteers may be students, employees, or people who are
  1074. neither students nor employees, the attribute \fIPerson\fP must 
  1075. contain a reference to a tuple in an arbitrary relation.
  1076. The following command appends all students to \fIVOLUNTEER\fP:
  1077. .BE
  1078. \fBappend\fP VOLUNTEER(
  1079.     Person = tuple(relation(S), S.oid))
  1080. \fBfrom\fP S \fBin\fP STUDENT*
  1081. .EE
  1082. The predefined function \fIrelation\fP returns the name of the relation
  1083. to which the tuple-variable \fIS\fP is bound.
  1084. .pp
  1085. The type \fItuple\fP will also be special-cased to make it more convenient.
  1086. \fITuple\fP will be a predefined type and it will be possible to
  1087. assign tuple-variables directly to attributes of the type.
  1088. Consequently, the assignment to \fIPerson\fP written above as
  1089. .BE
  1090.  ... Person = tuple(relation(S), S.oid) ...
  1091. .EE
  1092. can be written
  1093. .BE
  1094.  ... Person = S ...
  1095. .EE
  1096. We expect that as we get more experience with POSTGRES applications
  1097. that more types may be special-cased.
  1098. .sh 1 "User-Defined Procedures"
  1099. .pp
  1100. This section describes language constructs for
  1101. adding user-defined procedures to POSTQUEL.
  1102. User-defined procedures are written in a conventional programming
  1103. language and are used to implement ADT operators or to move a
  1104. computation from a front-end application process to the back-end
  1105. DBMS process.
  1106. .pp
  1107. Moving a computation to the back-end opens up possibilities for the
  1108. DBMS to precompute a query that includes the computation.
  1109. For example, suppose that a front-end application needed to fetch the
  1110. definition of a form from a database and to construct a main-memory
  1111. data structure that the run-time forms system used to display
  1112. the form on the terminal screen for data entry or display.
  1113. A conventional relation database design would store the form 
  1114. components (e.g., titles and field definitions for different types of 
  1115. fields such as scalar
  1116. fields, table fields, and graphics fields) in many different relations.
  1117. An example database design is:
  1118. .BE
  1119. \fBcreate\fP FORM(FormName, ...)
  1120. .sp 0.5v
  1121. \fBcreate\fP FIELDS(FormName, FieldName, 
  1122.     Origin, Height, Width, 
  1123.     FieldKind, ...)
  1124. .sp 0.5v
  1125. \fBcreate\fP SCALARFIELD(FormName,
  1126.     FieldName, DataType, 
  1127.     DisplayFormat, ...)
  1128. .sp 0.5v
  1129. \fBcreate\fP TABLEFIELD(FormName, 
  1130.     FieldName, NumberOfRows, ...)
  1131. .sp 0.5v
  1132. \fBcreate\fP TABLECOLUMNS(FormName, 
  1133.     FieldName, ColumnName, Height, 
  1134.     Width, FieldKind, ...)
  1135. .EE
  1136. The query that fetches the form from the database
  1137. must execute at least one query per table and
  1138. sort through the return tuples to construct the main-memory
  1139. data structure.
  1140. This operation must take less than two seconds for an interactive
  1141. application.
  1142. Conventional relational DBMS's cannot satisfy this time constraint.
  1143. .pp
  1144. Our approach to solving this problem is to move the computation that
  1145. constructs the main-memory data structure to the database process.
  1146. Suppose the procedure \fIMakeForm\fP built the data structure
  1147. given the name of a form.
  1148. Using the parameterized procedure-type mechanism defined above
  1149. an attribute can be added to the \fIFORM\fP relation that
  1150. stores the form representation computed by this procedure.
  1151. The commands
  1152. .BE
  1153. \fBdefine type\fP formrep \fBis\fP
  1154.     \fBretrieve\fP (rep = MakeForm($.FormName))
  1155. \fBend\fP
  1156. \fBaddattribute\fP (FormName, ..., 
  1157.     FormDataStructure = formrep) 
  1158. \fBto\fP FORM
  1159. .EE
  1160. define the procedure type and add an attribute to the \fIFORM\fP
  1161. relation.
  1162. .pp
  1163. The advantage of this representation is that POSTGRES can precompute
  1164. the answer to a procedure-type attribute and store it in the tuple.
  1165. By precomputing the main-memory data structure representation, the
  1166. form can be fetched from the database by a single-tuple retrieve:
  1167. .BE
  1168. \fBretrieve\fP (x = FORM.FormDataStructure)
  1169. \fBwhere\fP FORM.FormName = ``foo''
  1170. .EE
  1171. The real-time constraint to fetch and display a form can be easily
  1172. met if all the program must do is a single-tuple retrieve 
  1173. to fetch the data structure and call the library procedure to display it.
  1174. This example illustrates the advantage of moving a computation
  1175. (i.e., constructing a main-memory data structure) from
  1176. the application process to the DBMS process.
  1177. .pp
  1178. A procedure is defined to the system by specifying the names and
  1179. types of the arguments, the return type, the language it is
  1180. written in, and where the source and object code is stored.
  1181. For example, the definition
  1182. .BE
  1183. \fBdefine procedure\fP AgeInYears(date) \fBreturns\fP int4
  1184.     \fBis\fP (language = ``C'', filename = ``AgeInYears'')
  1185. .EE
  1186. defines a procedure \fIAgeInYears\fP that takes a \fIdate\fP value
  1187. and returns the age of the person.
  1188. The argument and return types are specified using POSTGRES types.
  1189. When the procedure is called, it is passed the arguments in the POSTGRES
  1190. internal representation for the type.
  1191. We plan to allow procedures to be written in several different
  1192. languages including C and Lisp which are the two languages being
  1193. used to implement the system.
  1194. .pp
  1195. POSTGRES stores the information about a procedure in the
  1196. system catalogs and dynamically loads the object code 
  1197. when it is called in a query.
  1198. The following query uses the \fIAgeInYears\fP procedure to 
  1199. retrieve the names and ages of all people in the example database:
  1200. .BE
  1201. \fBretrieve\fP (P.Name, 
  1202.         Age = AgeInYears(P.Birthdate))
  1203. \fBfrom\fP P \fBin\fP PERSON*
  1204. .EE
  1205. .pp
  1206. User-defined procedures can also take tuple-variable arguments.
  1207. For example, the following command defines a procedure, called
  1208. \fIComp\fP, that takes an EMPLOYEE tuple and computes the person's
  1209. compensation according to some formula that involves 
  1210. several attributes in the tuple (e.g.,
  1211. the employee's status, job title, and salary):
  1212. .BE
  1213. \fBdefine procedure\fP Comp(EMPLOYEE) 
  1214.     \fBreturns\fP int4 \fBis\fP (language = ``C'',
  1215.     filename = ``Comp1'')
  1216. .EE
  1217. Recall that a parameterized procedure-type is defined for each
  1218. relation automatically so the type \fIEMPLOYEE\fP
  1219. represents a reference to a tuple in the \fIEMPLOYEE\fP relation.
  1220. This procedure is called in the following query:
  1221. .BE
  1222. \fBretrieve\fP (E.Name, Compensation = Comp(E))
  1223. \fBfrom\fP E \fBin\fP EMPLOYEE
  1224. .EE
  1225. The C function that implements this procedure is passed a data
  1226. structure that contains the names, types, and values of the attributes
  1227. in the tuple.
  1228. .pp
  1229. User-defined procedures can be passed tuples in other relations
  1230. that inherit the attributes in the relation declared as the
  1231. argument to the procedure.
  1232. For example, the \fIComp\fP procedure defined for 
  1233. the \fIEMPLOYEE\fP relation can be passed a \fISTUDEMP\fP tuple as in 
  1234. .BE
  1235. \fBretrieve\fP (SE.Name, 
  1236.         Compensation = Comp(SE))
  1237. \fBfrom\fP SE \fBin\fP STUDEMP
  1238. .EE
  1239. because \fISTUDEMP\fP inherits data attributes from 
  1240. \fIEMPLOYEE\fP.
  1241. .pp
  1242. The arguments to procedures that take relation tuples as arguments
  1243. must be passed in a self-describing
  1244. data structure because the procedure can be passed tuples from different 
  1245. relations.
  1246. Attributes inherited from other relations
  1247. may be in different positions in the relations.
  1248. Moreover, the values passed for the same attribute name 
  1249. may be different types (e.g., the definition of an inherited attribute 
  1250. may be overridden with a different type).
  1251. The self-describing data structure is a list of arguments, one
  1252. per attribute in the tuple to be passed, with the following structure
  1253. .BE
  1254. (AttrName, AttrType, AttrValue)
  1255. .EE
  1256. The procedure code will have to search the list to find the desired
  1257. attribute.
  1258. A library of routines is provided that will hide this structure
  1259. from the programmer.
  1260. The library will include routines to get the type and value of an
  1261. attribute given the name of the attribute.
  1262. For example, the following code fetches the value of the
  1263. \fIBirthdate\fP attribute:
  1264. .BE
  1265. GetValue(``Birthdate'')
  1266. .EE
  1267. The problem of variable argument lists arises in all 
  1268. object-oriented programming languages and
  1269. similar solutions are used.
  1270. .pp
  1271. The model for procedure inheritance is nearly identical to
  1272. method inheritance in object-oriented programming languages
  1273. \*([[StB86\*(]].
  1274. Procedure inheritance uses the data inheritance hierarchy and
  1275. similar inheritance rules
  1276. except that a rule is provided to select a procedure when
  1277. an inheritance conflict arises.
  1278. For example, suppose that a \fIComp\fP procedure was defined for
  1279. \fISTUDENT\fP as well as for \fIEMPLOYEE\fP.
  1280. The definition of the second procedure might be:
  1281. .BE
  1282. \fBdefine procedure\fP Comp(STUDENT)
  1283.     \fBreturns\fP int4 \fBis\fP (language = ``C'',
  1284.     filename = ``Comp2'')
  1285. .EE
  1286. A conflict arises when the query on \fISTUDEMP\fP above is executed because
  1287. the system does not know which \fIComp\fP procedure to call (i.e.,
  1288. the one for \fIEMPLOYEE\fP or 
  1289. the one for \fISTUDENT\fP\|).
  1290. The procedure called is selected from among the procedures
  1291. that take a tuple from the relation specified by the actual argument
  1292. \fISTUDEMP\fP or any relation from which attributes
  1293. in the actual argument are inherited (e.g., \fIPERSON\fP, \fIEMPLOYEE\fP,
  1294. and \fISTUDENT\fP\|).
  1295. .pp
  1296. Each relation has an \fIinheritance precedence list\fP (IPL)
  1297. that is used to resolve the conflict.
  1298. The list is constructed by 
  1299. starting with the relation itself and doing a depth-first search up the 
  1300. inheritance hierarchy starting with the first relation specified in 
  1301. the \fBinherits\fP-clause.
  1302. For example, the \fBinherits\fP-clause for \fISTUDEMP\fP is
  1303. .BE
  1304.  ... \fBinherits\fP (STUDENT, EMPLOYEE)
  1305. .EE
  1306. and its IPL is
  1307. .BE
  1308. (STUDEMP, STUDENT,
  1309. \ EMPLOYEE, PERSON)
  1310. .EE
  1311. \fIPERSON\fP appears after \fIEMPLOYEE\fP rather than after 
  1312. \fISTUDENT\fP where it
  1313. would appear in a depth-first search because both \fISTUDENT\fP and
  1314. \fIEMPLOYEE\fP inherit attributes from \fIPERSON\fP (see figure 1).
  1315. In other words, all but the last occurrence of a relation in
  1316. the depth-first ordering of the hierarchy is deleted.\**
  1317. .(f
  1318. \** We are using a rule that is similar to the rule for the new Common Lisp
  1319. object model\*([<\*([[Boe86\*(]]\*(>].
  1320. It is actually slightly more complicated than described here in order to 
  1321. eliminate some nasty cases that arise when there are cycles
  1322. in the inheritance hierarchy.
  1323. .)f
  1324. .pp
  1325. When a procedure is called and passed a tuple as the first argument,
  1326. the actual procedure invoked is the first definition found with
  1327. the same name when the
  1328. procedures that take arguments from the relations in the ILP of the argument
  1329. are searched in order.
  1330. In the example above, the \fPComp\fP procedure defined for \fISTUDENT\fP 
  1331. is called because there is no procedure named \fIComp\fP defined for
  1332. \fISTUDEMP\fP and \fISTUDENT\fP is the next relation in the IPL.
  1333. .pp
  1334. The implementation of this procedure selection rule is relatively easy.
  1335. Assume that two system catalogs are defined:
  1336. .BE
  1337. PROCDEF(ProcName, ArgName, ProcId)
  1338. IPL(RelationName, IPLEntry, SeqNo)
  1339. .EE
  1340. where \fIPROCDEF\fP has an entry for each procedure defined and
  1341. \fIIPL\fP maintains the precedence lists for all relations.
  1342. The attributes in \fIPROCDEF\fP represent the procedure name, the argument type
  1343. name, and the unique identifier for the procedure code
  1344. stored in another catalog.
  1345. The attributes in \fIIPL\fP represent the relation, an IPL entry for the
  1346. relation, and the sequence number for that entry in the IPL of the relation.
  1347. With these two catalogs, the query to find the correct procedure for
  1348. the call
  1349. .BE
  1350. Comp(STUDEMP)
  1351. .EE
  1352. is\**
  1353. .(f
  1354. \** This query uses a QUEL-style aggregate function.
  1355. .)f
  1356. .BE
  1357. \fBretrieve\fP (P.ProcId)
  1358. \fBfrom\fP P \fBin\fP PROCDEF, I \fBin\fP IPL
  1359. \fBwhere\fP P.ProcName = ``Comp''
  1360.   \fBand\fP I.RelationName = ``STUDEMP''
  1361.   \fBand\fP I.IPLEntry = P.ArgName
  1362.   \fBand\fP I.SeqNo = MIN(I.SeqNo 
  1363.     \fBby\fP I.RelationName
  1364.     \fBwhere\fP\ \ I.IPLEntry = P.ArgName
  1365.           \fBand\fP P.ProcName = ``Comp''
  1366.           \fBand\fP I.RelationName = ``STUDEMP'')
  1367. .EE
  1368. This query can be precomputed to speed up procedure selection.
  1369. .pp
  1370. In summary, the major changes required to support procedure inheritance
  1371. is 1) allow tuples as arguments to procedures, 2) define a representation
  1372. for variable argument lists, and 3) implement a procedure selection
  1373. mechanism.
  1374. This extension to the relational model is relatively straightforward
  1375. and only requires a small number of changes to the DBMS implementation.
  1376. .sh 1 "Other Data Models"
  1377. .pp
  1378. This section compares the POSTGRES data model to 
  1379. semantic, functional, and object-oriented data models.
  1380. .pp
  1381. Semantic and functional data models 
  1382. \*([[Dae85\*(],HaM81\*(],Mye80\*(],Shi81\*(],SmS77\*(],Zan83\*(]]
  1383. do not provide the flexibility provided by the model described here.
  1384. They cannot easily represent data with uncertain structure
  1385. (e.g., objects with shared subobjects that have different types).
  1386. .pp
  1387. Modeling ideas oriented toward complex objects\*([<\*([[HaL82\*(],LoP83\*(]]\*(>]
  1388. cannot deal with objects that have a variety of shared subobjects.  
  1389. POSTGRES uses procedures to represent shared subobjects
  1390. which does not have limitation on the types of subobjects
  1391. that are shared.  
  1392. Moreover, the nested-dot notation allows convenient access to selected 
  1393. subobjects, a feature not present in these systems.
  1394. .pp
  1395. Several proposals have been made to support data models
  1396. that contain non-first normal form relations 
  1397. \*([[Bae86\*(],Dae86\*(],Dee86\*(]].
  1398. The POSTGRES data model can be used to support non-first normal form
  1399. relations with procedure-types.  
  1400. Consequently, POSTGRES seems to contain a
  1401. superset of the capabilities of these proposals. 
  1402. .pp
  1403. Object-oriented data models\*([<\*([[Ane86\*(],CoM84\*(]]\*(>]
  1404. have modeling constructs to deal with uncertain structure.
  1405. For example, GemStone supports union types which can be used to
  1406. represent subobjects that have different types\*([<\*([[CoM84\*(]]\*(>].
  1407. Sharing of subobjects is represented by storing the subobjects 
  1408. as separate records and connecting them to a parent object with 
  1409. pointer-chains.
  1410. Precomputed procedure values will, in our opinion, make POSTGRES 
  1411. performance competitive with pointer-chain proposals.
  1412. The preformance problem with pointer-chains will be most obvious
  1413. when an object is composed of a large number of subobjects.
  1414. POSTGRES will avoid this problem because the pointer-chain is represented
  1415. as a relation and the system can use all of the query processing and 
  1416. storage structure techniques available in the system to represent it.
  1417. Consequently, POSTGRES uses a different approach that supports the
  1418. same modeling capabilities and an implementation that may have
  1419. better performance.
  1420. .pp
  1421. Finally, the POSTGRES data model could claim to be object-oriented, though we
  1422. prefer not to use this word because few people agree on exactly what
  1423. it means.
  1424. The data model provides the same capabilities as an object-oriented model,
  1425. but it does so without discarding the relational model and without having
  1426. to introduce a new confusing terminology.
  1427. .sh 1 "Summary"
  1428. .pp
  1429. The POSTGRES data model uses the ideas of abstract data types,
  1430. data of type procedure, and inheritance to extend the relational model.
  1431. These ideas can be used to simulate a variety of semantic data modeling
  1432. concepts (e.g., aggregation and generalization).
  1433. In addition, the same ideas can be used to support complex objects that
  1434. have unpredicatable composition and shared subobjects.
  1435. .sp 2
  1436. .(l C
  1437. .sz \n(sp
  1438. .b References
  1439. .)l
  1440. .sp
  1441. .[]
  1442. .[-
  1443. .ds [F AdL80
  1444. .ds [A M\*(p]\*(a]E\*(p] Adiba
  1445. .as [A \*(n]B\*(p]\*(a]G\*(p] Lindsay
  1446. .ds [T Database Snapshots
  1447. .ds [J Proc. 6th Int. Conf. on Very Large Databases
  1448. .ds [C Montreal, Canada
  1449. .ds [D Oct. 1980
  1450. .nr [P 1
  1451. .ds [P 86-91
  1452. .][
  1453. .[-
  1454. .ds [F Ane86
  1455. .ds [A T\*(p] Anderson
  1456. .as [A \*(n]et.\ al.
  1457. .ds [T PROTEUS: Objectifying the DBMS User Interface
  1458. .ds [J Proc. Int. Wkshp on Object-Oriented Database Systems
  1459. .ds [C Asilomar, CA
  1460. .ds [D Sep. 1986
  1461. .][
  1462. .[-
  1463. .ds [F Bae86
  1464. .ds [A D\*(p] Batory
  1465. .as [A \*(n]et.al.
  1466. .ds [T GENESIS: A Reconfigurable Database Management System
  1467. .ds [R Tech. Rep. 86-07
  1468. .ds [I Dept. of Comp. Sci., Univ. of Texas at Austin
  1469. .ds [D 1986
  1470. .][
  1471. .[-
  1472. .ds [F Boe86
  1473. .ds [A D\*(p]\*(a]B\*(p] Bobrow
  1474. .as [A \*(n]et.al.
  1475. .ds [T COMMONLOOPS: Merging Lisp and Object-Oriented Programming
  1476. .ds [J Proc. 1986 ACM OOPSLA Conf.
  1477. .ds [C Portland, OR
  1478. .ds [D Sep. 1986
  1479. .nr [P 1
  1480. .ds [P 17-29
  1481. .][
  1482. .[-
  1483. .ds [F Cod70
  1484. .ds [A E\*(p]\*(a]F\*(p] Codd
  1485. .ds [T A Relational Model of Data for Large Shared Data Bases
  1486. .ds [J Comm. of the ACM
  1487. .ds [D JUNE 1970
  1488. .][
  1489. .[-
  1490. .ds [F CoM84
  1491. .ds [A G\*(p] Copeland
  1492. .as [A \*(n]D\*(p] Maier
  1493. .ds [T Making Smalltalk a Database System
  1494. .ds [J Proc. 1984 ACM-ACM-S\&IGMOD Conf. on Management of Data Int. Conf. on the Mgt. of Data
  1495. .ds [D June 1984
  1496. .][
  1497. .[-
  1498. .ds [F Dae86
  1499. .ds [A P\*(p] Dadam
  1500. .as [A \*(n]et.al.
  1501. .ds [T A DBMS Prototype to Support Extended NF2 Relations: An Integrated View on Flat Tables and Hierarchies
  1502. .ds [J Proc. ACM-ACM-S\&IGMOD Conf. on Management of Data Conf. on Mgt. of Data
  1503. .ds [C Washington, DC
  1504. .ds [D May 1986
  1505. .][
  1506. .[-
  1507. .ds [F Dae85
  1508. .ds [A U\*(p] Dayal
  1509. .as [A \*(n]et.al.
  1510. .ds [T A Knowledge-Oriented Database Management System
  1511. .ds [J Proc. Islamorada Conference on Large Scale Knowledge Base and Reasoning Systems
  1512. .ds [D Feb. 1985
  1513. .][
  1514. .[-
  1515. .ds [F Dee86
  1516. .ds [A U\*(p] Deppisch
  1517. .as [A \*(n]et.al.
  1518. .ds [T A Storage System for Complex Objects
  1519. .ds [J Proc. Int. Wkshp on Object-Oriented Database Systems
  1520. .ds [C Asilomar, CA
  1521. .ds [D Sep. 1986
  1522. .][
  1523. .[-
  1524. .ds [F Gae84
  1525. .ds [A H\*(p] Garcia-Molina
  1526. .as [A \*(n]et.al.
  1527. .ds [T DataPatch: Integrating Inconsistent Copies of a Database after a Partition
  1528. .ds [R Tech. Rep. Tech. Rep.# 304
  1529. .ds [I Dept. Elec. Eng. and Comp. Sci.
  1530. .ds [C Princeton, NJ
  1531. .ds [D 1984
  1532. .][
  1533. .[-
  1534. .ds [F HaM81
  1535. .ds [A M\*(p] Hammer
  1536. .as [A \*(n]D\*(p] McLeod
  1537. .ds [T Database Description with SDM
  1538. .ds [J ACM-Trans. Database Systems
  1539. .ds [D Sep. 1981
  1540. .][
  1541. .[-
  1542. .ds [F HaL82
  1543. .ds [A R\*(p] Haskins
  1544. .as [A \*(n]R\*(p] Lorie
  1545. .ds [T On Extending the Functions of a Relational Database System
  1546. .ds [J Proc. 1982 ACM-ACM-S\&IGMOD Conf. on Management of Data Conference on Management of Data
  1547. .ds [C Orlando, FL
  1548. .ds [D JUNE 1982
  1549. .][
  1550. .[-
  1551. .ds [F HSW75
  1552. .ds [A G\*(p] Held
  1553. .as [A \*(c]M\*(p]\*(a]R\*(p] Stonebraker
  1554. .as [A \*(m]E\*(p] Wong
  1555. .ds [T INGRES -- A Relational Data Base System
  1556. .ds [J Proc. AFIPS AFIPS Nat. Computer Conf.
  1557. .ds [D 1975
  1558. .nr [P 1
  1559. .ds [P 409-416
  1560. .][
  1561. .[-
  1562. .ds [F Kue84
  1563. .ds [A R\*(p] Kung
  1564. .as [A \*(n]et.al.
  1565. .ds [T Heuristic Search in Database Systems
  1566. .ds [J Proc. 1st International Workshop on Expert Data Bases
  1567. .ds [C Kiowah, SC
  1568. .ds [D Oct. 1984
  1569. .][
  1570. .[-
  1571. .ds [F LoP83
  1572. .ds [A R\*(p] Lorie
  1573. .as [A \*(n]W\*(p] Plouffee
  1574. .ds [T Complex Objects and Their Use in Design Transactions
  1575. .ds [J Proc. Engineering Design Applications Stream of ACM-IEEE Data Base Week
  1576. .ds [C San Jose, CA
  1577. .ds [D May 1983
  1578. .][
  1579. .[-
  1580. .ds [F Mye80
  1581. .ds [A J\*(p] Myloupoulis
  1582. .as [A \*(n]et.al.
  1583. .ds [T A Language Facility for Designing Database Intensive Applications
  1584. .ds [J ACM-Trans. Database Systems
  1585. .ds [D JUNE 1980
  1586. .][
  1587. .[-
  1588. .ds [F Row86
  1589. .ds [A L\*(p]\*(a]A\*(p] Rowe
  1590. .ds [T A Shared Object Hierarchy
  1591. .ds [J Proc. Int. Wkshp on Object-Oriented Database Systems
  1592. .ds [C Asilomar, CA
  1593. .ds [D Sep. 1986
  1594. .][
  1595. .[-
  1596. .ds [F Shi81
  1597. .ds [A D\*(p] Shipman
  1598. .ds [T The Functional Model and the Data Language Daplex
  1599. .ds [J ACM-Trans. Database Systems
  1600. .ds [D Mar. 1981
  1601. .][
  1602. .[-
  1603. .ds [F SmS77
  1604. .ds [A J\*(p] Smith
  1605. .as [A \*(n]D\*(p] Smith
  1606. .ds [T Database Abstractions: Aggregation and Generalization
  1607. .ds [J ACM Trans. Database Systems
  1608. .ds [D JUNE 1977
  1609. .][
  1610. .[-
  1611. .ds [F StB86
  1612. .ds [A M\*(p] Stefik
  1613. .as [A \*(n]D\*(p]\*(a]G\*(p] Bobrow
  1614. .ds [T Object-Oriented Programming: Themes and Variations
  1615. .ds [J The AI Magazine
  1616. .ds [V 6
  1617. .ds [N 4
  1618. .ds [D Winter 1986
  1619. .nr [P 1
  1620. .ds [P 40-62
  1621. .][
  1622. .[-
  1623. .ds [F Ste84
  1624. .ds [A M\*(p]\*(a]R\*(p] Stonebraker
  1625. .as [A \*(n]et.\ al.
  1626. .ds [T QUEL as a Data Type
  1627. .ds [J Proc. 1984 ACM-ACM-S\&IGMOD Conf. on Management of Data Conf. on the Mgt. of Data
  1628. .ds [D May 1984
  1629. .][
  1630. .[-
  1631. .ds [F Sto85
  1632. .ds [A M\*(p]\*(a]R\*(p] Stonebraker
  1633. .ds [T Triggers and Inference in Data Base Systems
  1634. .ds [J Proc. Islamorada Conference on Large Scale Knowledge Base and Reasoning Systems
  1635. .ds [D Feb. 1985
  1636. .][
  1637. .[-
  1638. .ds [F StR86
  1639. .ds [A M\*(p]\*(a]R\*(p] Stonebraker
  1640. .as [A \*(n]L\*(p]\*(a]A\*(p] Rowe
  1641. .ds [T The Design of POSTGRES
  1642. .ds [J Proc. 1986 ACM-ACM-S\&IGMOD Conf. on Management of Data Int. Conf. on the Mgt. of Data
  1643. .ds [D June 1986
  1644. .][
  1645. .[-
  1646. .ds [F Sto86a
  1647. .ds [A M\*(p]\*(a]R\*(p] Stonebraker
  1648. .ds [T Object Management in POSTGRES Using Procedures
  1649. .ds [J Proc. Int. Wkshp on Object-Oriented Database Systems
  1650. .ds [C Asilomar, CA
  1651. .ds [D Sep. 1986
  1652. .][
  1653. .[-
  1654. .ds [F Sto86b
  1655. .ds [A M\*(p]\*(a]R\*(p] Stonebraker
  1656. .ds [T Inclusion of New Types in Relational Data Base Systems
  1657. .ds [J Proc. Second Int. Conf. on Data Base Eng.
  1658. .ds [C Los Angeles, CA
  1659. .ds [D Feb. 1986
  1660. .][
  1661. .[-
  1662. .ds [F Sto87
  1663. .ds [A M\*(p]\*(a]R\*(p] Stonebraker
  1664. .ds [T POSTGRES Storage System
  1665. .ds [R Submitted for publication
  1666. .ds [D 1987
  1667. .][
  1668. .[-
  1669. .ds [F Zan83
  1670. .ds [A C\*(p] Zaniola
  1671. .ds [T The Database Language GEM
  1672. .ds [J Proc. 1983 ACM-ACM-S\&IGMOD Conf. on Management of Data Conference on Management of Data
  1673. .ds [C San Jose, CA.
  1674. .ds [D May 1983
  1675. .][
  1676.